﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GenUtil.Util;
using GenUtil.Dto;
using DataLayer.Dao;

namespace ServiceLayer.Service.Impl
{
    public class LoginSeriviceImpl : LoginSerivice
    {
        Logger logger = new Logger(typeof(CustomerServiceImpl));

        public LoginDto GetLoginDto(int userId)
        {
            logger.debug("Entering LoginSerivicImpl.GetLoginDto()");
            LoginDto loginDto = null;
            try
            {
                loginDto = DaoFactory.getLoginDao().GetLoginDto(userId);
            }
            catch (Exception e)
            {
                logger.fatal("Exception in LoginSerivicImpl.GetLoginDto():" + e.Message, e);
                throw new Exception("Exception in LoginSerivicImpl.GetLoginDto():" + e.Message, e);
            }
            logger.debug("Exiting LoginSerivicImpl.GetLoginDto()");
            return loginDto;
        }
        public List<LoginDto> getLoginDtos()
        {
            logger.debug("Entering LoginSerivicImpl.getLoginDtos()");
            List<LoginDto> LoginDtos = null;
            try
            {
                LoginDtos = DaoFactory.getLoginDao().getLoginDto();
            }
            catch (Exception e)
            {
                logger.fatal("Exception in LoginSerivicImpl.getLoginDtos():" + e.Message, e);
                throw new Exception("Exception in LoginSerivicImpl.getLoginDtos():" + e.Message, e);
            }
            logger.debug("Exiting LoginSerivicImpl.getLoginDtos()");
            return LoginDtos;
        }
    }
}
